<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Template • TodoMVC</title>
    <link rel="stylesheet" href="./css/base.css" />
    <link rel="stylesheet" href="./css/index.css" />
    <!-- CSS overrides - remove if you don't need it -->
    <link rel="stylesheet" href="./css/app.css" />
  </head>
  <body>
    <section class="todoapp" id="todoapp">
      <header class="header">
        <h1>todos</h1>
        <input
          class="new-todo"
          placeholder="What needs to be done?"
          @keyDown.enter="add"
          v-model.trim="todoName"
          autofocus
        />
      </header>
      <!-- This section should be hidden by default and shown when there are todos -->
      <section class="main">
        <input
          id="toggle-all"
          class="toggle-all"
          type="checkbox"
          v-model="checkAll"
        />
        <label for="toggle-all">Mark all as complete</label>
        <ul class="todo-list">
          <!-- These are here just to show the structure of the list items -->
          <!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
          <li
            :class="{completed:item.done,editing:editId === item.id}"
            v-for="(item,index) in todoList"
            :key="item.id"
          >
            <div class="view">
              <input class="toggle" type="checkbox" v-model="item.done" />
              <label @dblclick="edit(item.id)">{{item.todoName}}</label>
              <button class="destroy" @click="del(item.id)"></button>
            </div>
            <input
              class="edit"
              v-model.lazy="item.todoName"
              @blur="update"
              @keyup.enter="update"
              @keyup.esc="update"
            />
          </li>
        </ul>
      </section>
      <!-- This footer should be hidden by default and shown when there are todos -->
      <footer class="footer" v-show="todoList.length">
        <!-- This should be `0 items left` by default -->
        <span class="todo-count"><strong>{{leftCount}}</strong> item left</span>
        <!-- Remove this if you don't implement routing -->
        <ul class="filters">
          <li>
            <a class="selected" href="#/">All</a>
          </li>
          <li>
            <a href="#/active">Active</a>
          </li>
          <li>
            <a href="#/completed">Completed</a>
          </li>
        </ul>
        <!-- Hidden if no completed items are left ↓ -->
        <button
          class="clear-completed"
          v-show="isShowClearCompleted"
          @click="clear"
        >
          Clear completed
        </button>
      </footer>
    </section>
    <!-- Scripts here. Don't remove ↓ -->
    <script src="../js/vue.js"></script>
    <script src="js/app.js"></script>
  </body>
</html>
